class PizzaStore{
	public:
		Pizza * orderPizza(string type) {
			Pizza *pizza = NULL;
			pizza =createPizza(type);
			pizza->prepare();
			pizza->bake();
			pizza->cut();
			pizza->box();
			return pizza;
		}
	       Pizza * createPizza(string type) = 0;
};

class NYPizzaFactory:public PizzaStore{
	public:
		virtual Pizza * createPizza(string type){
			Pizza *pizza = NULL;
		     	if(type == "cheese"){
		     		pizza = new NYCheesePizza();
		     	}else if(type == "greek"){
		     		pizza = new NYGreekPizza();
		     	}else if(type == "pepperoni"){
		     		pizza = new NYPepperoniPizza();
		     	}	
			return pizza;			
		}
};

class  ChicagoPizzaFactory:public PizzaStore{
	public:
		virtual Pizza * createPizza(string type){
			Pizza *pizza = NULL;
		     	if(type == "cheese"){
		     		pizza = new  ChicagoCheesePizza();
		     	}else if(type == "greek"){
		     		pizza = new  ChicagoGreekPizza();
		     	}else if(type == "pepperoni"){
		     		pizza = new  ChicagoPepperoniPizza();
		     	}	
			return pizza;			
		}
};

